package com.huang.design.structural.adapter.clazz;

import com.huang.design.structural.adapter.Player;
import com.huang.design.structural.adapter.Zh_JPTranslator;

//通过继承方式  类结构模型
public class JPMoviePlayAdapter extends Zh_JPTranslator implements Player {
    private Player target;//被适配对象
    public JPMoviePlayAdapter(Player target) {
        this.target=target;
    }

    @Override
    public String play() {
        String play = target.play();
        //转换字幕
        String translate = translate(play);
        System.out.println("日文：--"+translate);
        return translate;
    }
}
